/**
 * 用户信息相关接口
 */
import { queryParams } from 'uview-plus';
import type { UserLoginResult, UserUserInfoResult, userLoginParams } from './types';
import { get, post } from '@/utils/request';

enum URL {
  /*
  login = '/user/login',
  loginByCode = '/user/loginByCode',
  logout = '/user/logout',
  profile = '/user/profile',
  */
  userLogin = '/user/login',
  userUserInfo = '/user/userInfo',
  updateUserInfo = '/user/update',
  mineUserInfo = '/user/mine',
  userJobInteractionList = '/position/interaction/list',
  userJobInteractionUpdate = '/position/interaction/update',
  userResumeList = '/resume/list',
  userResumeDetail = '/resume/detail',
  userResumeDel = '/resume/del',
  userResumeUpdate = '/resume/update',
  userJobList = '/position/list',
  userJobDetail = '/position/detail',
  userJobType = '/position/type',
  userMore = '/user/more',
  userTeacherRecommend = '/position/resume/recommend/teacher/list',
  userActivityList = '/common/activity/list',
  userActivityDetail = '/common/activity/detail',
  userActivityJoin = '/common/activity/join',
  userBanner = '/home/banner',
  userEduList = '/resume/education/list',
  userEduDetail = '/resume/education/detail',
  userEduUpdate = '/resume/education/update',
  userEduDelete = '/resume/education/delete',
  userEduAdd = '/resume/education/add',
  userIntentionList = '/resume/intention/list',
  userJobResumeList = '/position/resume/send/list',
  userHrDetail = '/position/hr/detail',
  companyDetail = '/company/detail',
  companyHighlightsDetail = '/company/highlights',
  teacherList = '/position/teacher/list',
  hrLookResumeList = '/hr/resume/list',
  hrRectiveResumeList = '/position/resume/recive/list',
  hrResumeStatusUpdate = '/position/resume/recive/update',
  addEdu = '/resume/education/add',
  addUserIntention = '/resume/intention/add',
  statisticsJobType = '/position/statistics/position/type',
  statisticsJob = '/position/statistics/detail',
  hrLookJobCount = '/hr/job/status/count',
  hrLookTeacherRecomment = '/hr/resume/recommend/list',
  userResumeAdd = '/resume/add',
  userResumeSend = '/position/resume/send',
  addResearch = '/resume/scientific/add',
  userJobAdd = '/resume/job/add', //实习经历
  userInSchoolAdd = '/resume/school/add',  //在校经历
  userHonorAdd = '/resume/honor/add',  //荣誉经历
  hrJobAdd = '/position/add',     //发布职位
  chatList = '/common/chat/list',      //拆分职位偏好
  majorList = '/common/config/major',  //专业列表
  companyUpdate = '/company/update',  //公司信息更新


}

/*
export const getUserProfile = () => get<UserState>({ url: URL.profile });
export const login = (data: LoginParams) => post<LoginResult>({ url: URL.login, data });
export const loginByCode = (data: LoginByCodeParams) => post<any>({ url: URL.loginByCode, data });
export const logout = () => post<any>({ url: URL.logout });
*/

export const userLogin = (params: userLoginParams) => post<UserLoginResult>({ url: `${URL.userLogin}${queryParams(params)}` });
export const userUserInfo = () => get<UserUserInfoResult>({ url: URL.userUserInfo });
export const mineUserInfo = () => get<any>({ url: URL.mineUserInfo });
export const userResumeList = () => get<any>({ url: URL.userResumeList });
export const userResumeDetail = (data: any) => get<any>({ url: URL.userResumeDetail, params: data });
export const userJobType = () => get<any>({ url: URL.userJobType });
export const userMore = () => get<any>({ url: URL.userMore });
export const userEduList = () => get<any>({ url: URL.userEduList });
export const userJobInteractionList = (data: any) => get<any>({ url: URL.userJobInteractionList, params: data });
export const userJobInteractionUpdate = (data: any) => post<any>({ url: URL.userJobInteractionUpdate, params: data });
export const updateUserInfo = (data: any) => post<any>({ url: URL.updateUserInfo, params: data });
export const userJobList = (data: any) => get<any>({ url: URL.userJobList, params: data });
export const userJobDetail = (data: any) => get<any>({ url: URL.userJobDetail, params: data });
export const userTeacherRecommend = (data: any) => get<any>({ url: URL.userTeacherRecommend, params: data });
export const userActivityList = (data: any) => get<any>({ url: URL.userActivityList, params: data });
export const userActivityDetail = (data: any) => get<any>({ url: URL.userActivityDetail, params: data });
export const userActivityJoin = (data: any) => post<any>({ url: URL.userActivityJoin, params: data });
export const userBanner = (data: any) => get<any>({ url: URL.userBanner, params: data });

//求职偏好相关
export const userIntentionList = () => get<any>({ url: URL.userIntentionList });
//简历投递列表
export const userJobResumeList = (data:any) => get<any>({ url: URL.userJobResumeList, params: data });
//hr详情
export const userHrDetail = (data: any) => get<any>({ url: URL.userHrDetail, params: data });
//公司详情
export const companyDetail = (data: any) => get<any>({ url: URL.companyDetail, params: data });
//公司亮点
export const companyHighlightsDetail = (data: any) => get<any>({ url: URL.companyHighlightsDetail, params: data });
//老师列表
export const teacherList = (data: any) => get<any>({ url: URL.teacherList, params: data });
//hr查看简历列表
export const hrLookResumeList = (data: any) => get<any>({ url: URL.hrLookResumeList, params: data });
//简历删除
export const userResumeDel = (data: any) => post<any>({ url: URL.userResumeDel, params: data });
//hr接收简历
export const hrRectiveResumeList = (data: any) => get<any>({ url: URL.hrRectiveResumeList, params: data });
export const hrResumeStatusUpdate = (data: any) => post<any>({ url: URL.hrResumeStatusUpdate, params: data });
//添加教育经历
export const addEdu = (data: any) => post<any>({ url: URL.addEdu, params: data });
//添加求职偏好
export const addUserIntention = (data: any) => post<any>({ url: URL.addUserIntention, params: data });
//招聘漏斗
export const statisticsJobType = (data: any) => get<any>({ url: URL.statisticsJobType, params: data });
export const statisticsJob = (data: any) => get<any>({ url: URL.statisticsJob, params: data });
//hr查看职位数量列表
export const hrLookJobCount = () => get<any>({ url: URL.hrLookJobCount });
//hr查看老师推荐简历列表
export const hrLookTeacherRecomment = (data: any) => get<any>({ url: URL.hrLookTeacherRecomment, params: data });
//新增简历
export const userResumeAdd = () => post<any>({ url: URL.userResumeAdd });
//发送简历
export const userResumeSend = (data: any) => post<any>({ url: URL.userResumeSend, params: data });
//新增科研经历
export const addResearch = (data: any) => post<any>({ url: URL.addResearch, params: data });
//新增实习经历
export const userJobAdd = (data: any) => post<any>({ url: URL.userJobAdd, params: data });
//新增在校经历
export const userInSchoolAdd = (data: any) => post<any>({ url: URL.userInSchoolAdd, params: data });
//新增荣誉经历
export const userHonorAdd = (data: any) => post<any>({ url: URL.userHonorAdd, params: data });
//更新简历
export const userResumeUpdate = (data: any) => post<any>({ url: URL.userResumeUpdate, params: data });
//聊天列表
export const chatList = (data: any) => get<any>({ url: URL.chatList, params: data });
//专业列表
export const majorList = () => get<any>({ url: URL.majorList });
//公司信息更新
export const companyUpdate = (data: any) => post<any>({ url: URL.companyUpdate, params: data });



//获取Tim的参数
export const getTimDataApi = (params: any) => get<any>({ url: 'user/imInfo' , params: params})

//获取二三级
export const resumeSkillList = (params: any) => get<any>({ url: '/resume/skill/list', params: params });

// 获取一级
export const resumeTypeList = (params: any) => get<any>({ url: '/resume/skill/type/list', params: params });
export const WxLogin = (params: any) => post<any>({ url: '/user/wxLogin', params: params });

export const commonImage = (params: any) => get<any>({ url: '/common/image', params: params });
//-----------------------------------------------企业相关-----------------------------------------------
//发布职位
export const hrJobAdd = (data: any) => post<any>({ url: URL.hrJobAdd, params: data });

//公司福利
export const configHighlights = () => get<any>({url: '/common/config/highlights'})
// 企业投诉
export const QyTs = (data: any) => post<any>({ url: 'user/complaint/company', params: data });
//意见反馈
export const YjFk = (data: any) => post<any>({ url: 'user/feedback', params: data });
// 直播列表
export const broadcast = (data: any) => get<any>({ url: 'home/live/broadcast', params: data });
// 添加简历
export const addAnnexResume = (data: any) => post<any>({ url: 'resume/annex/add', params: data });
// 微信上传简历列表
export const annexList = (data: any) => get<any>({ url: 'resume/annex/list', params: data });
// 删除简历
export const delAnnexResume = (data: any) => post<any>({ url: 'resume/annex/del', params: data });
// 获取求职偏好详情
export const getIntentionDetail = (data: any) => get<any>({ url: 'resume/intention/detail', params: data });
export const getIntentionDetailUpdate = (data: any) => post<any>({ url: 'resume/intention/update', params: data });
export const getIntentionDetailDel = (data: any) => post<any>({ url: 'resume/intention/del', params: data });

export const getEduDetails = (data: any) => get<any>({ url: 'resume/education/detail', params: data})
export const getEduUpdate = (data: any) => post<any>({ url: 'resume/education/update', params: data})
export const delEdu = (data: any) => post<any>({ url: 'resume/education/del', params: data})
